package com.isoft.demo.dao;

import com.isoft.demo.entity.Filial;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface FilialDao {
    //增加
    @Insert("insert into filial (fname,branchmanage,faddress,fphone) values (#{fname},#{branchmanage},#{faddress},#{fphone})")
    int addFilial(Filial filial);
//    //删除
//    @Delete("delete from filial where fid=#{fid}")
//    int deleteFilial(int fid);
    //修改
    @Update("update filial set fname=#{fname},branchmanage=#{branchmanage},faddress=#{faddress},fphone=#{fphone} where fid=#{fid}")
    int updateFilial(Filial filial);
    //查询
    @Select("select * from filial")
    List<Filial>searchAll();
    //根据id查询
    @Select("select fid from filial")
    List<Filial> findByFid(Integer fid);
}
